#include<bits/stdc++.h>
using namespace std;
const int N=1e5+1e3;
int p[N],b[N];
int main(){
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	int n,a[N],s[N],g=0,cnt=1;
	cin>>n;
	for(int i=1;i<=n;i++)
	cin>>a[i];
	for(int i=1;i<=n;i++)
	p[a[i]]++;
	for(int j=1;j<=N;j++)
	{
		if(p[j]!=0)
		b[cnt++]=p[j];
	}
	s[1]=0;
	for(int i=2;i<cnt;i++)
	s[i]+=s[i-1]+b[i-1];
	for(int i=2;i<cnt;i++)
	{
		if(b[i]>s[i])
		g+=s[i];
		else
		g+=b[i];
		s[i+1]-=g;
	}
	cout<<n-g;
	return 0;
}
